/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package kasus.model;

/**
 *
 * @author admin
 */
import java.sql.Connection;
import java.sql.DriverManager;


public class ConnectionOracle {

// jdbc:oracle:thin merupaka jenis JDBC
// angka 172.23.9.185 merupakan IP server oracle
// angka 1521 menunjukkan port server Oracle yang bisa diakses
// orcl merupakan nama listener server database oracle
    String jdbcUrl = "jdbc:oracle:thin:@localhost:1521:XE";
    String userid = "HR"; // gantikan dengan username anda
    String password = "karmelia"; // gantikan dengan password anda
    String driver = "oracle.jdbc.driver.OracleDriver";
    Connection conn;

    public Connection logon() {
        try {
            Class.forName(driver);
            conn = DriverManager.getConnection(jdbcUrl, userid, password);
            System.out.println("Koneksi berhasil");
        } catch (Exception ex) {
            ex.printStackTrace();
            System.out.println("error :" + ex.getMessage());
        }


        return conn;
    }
    
}
